package org.jeecg.modules.scm.service.impl;

import cn.hutool.core.util.URLUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.modules.scm.entity.ScmCusDeputyProtocol;
import org.jeecg.modules.scm.mapper.ScmCusDeputyProtocolMapper;
import org.jeecg.modules.scm.service.IScmCusDeputyProtocolService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description: scm_cus_deputy_protocol
 * @Author: jeecg-boot
 * @Date:   2021-11-27
 * @Version: V1.0
 */
@Service
public class ScmCusDeputyProtocolServiceImpl extends ServiceImpl<ScmCusDeputyProtocolMapper, ScmCusDeputyProtocol> implements IScmCusDeputyProtocolService {

    @Override
    public String upload(MultipartFile file) {
        String url = CommonUtils.upload(file, "/cusDeputyProtocol/accessory", CommonConstant.UPLOAD_TYPE_MINIO);
        String path = URLUtil.getPath(url);
        return path;
    }
}
